﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;

namespace BusinessLibrary.BLL
{
  public  class Chef_Departement
    {
        # region var
        public int Id { get; set; }
        public string Nom { get; set; }
        public string Prenom { get; set; }
        public int Cin { get; set; }
        public string Num_tel { get; set; }
        public string Email { get; set; }
        public Authentification authentificationChef { get; set; }
        public Departement departement { get; set; }


        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Chef_Departement GetChef_DepartementById(int id)
        {
            return sqlChef_Departement.GetChef_DepartementById(id);
        }


        public static int deleteChef_Departement(int id, int idAuthent)
        {
            return sqlChef_Departement.deletChef_Departement(id, idAuthent);
        }


        public static int SaveChef_Departement(Chef_Departement c)
        {
            int nbRow;
            if ((nbRow = sqlChef_Departement.updateChef_Departement(c)) > 0)
                return nbRow;
            else
                return sqlChef_Departement.insertChef_Departement(c);
        }
    }
        #endregion
}
